#!/bin/bash
set -e

# 全局变量

export REDIS_SOURCE_DIR=/root/redis-5.0.5
export BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

export MASTER1_PORT=7001
export MASTER2_PORT=7002
export MASTER3_PORT=7003
export SLAVE1_PORT=8001
export SLAVE2_PORT=8002
export SLAVE3_PORT=8003


# 创建redis集群
cd ${BASE_DIR}/master1
./bin/redis-cli --cluster create 172.17.0.4:7001 172.17.0.4:7002 172.17.0.4:7003 \
172.17.0.4:8001 172.17.0.4:8002 172.17.0.4:8003 \
--cluster-replicas 1
